package io.gitee.cisumer.amazing.master;

import io.gitee.cisumer.amazing.Pixel;

import static java.lang.Math.*;

/**
 * @author gitee.com/cisumer
 * @date create in 2022/3/17
 */
public class Ground implements Pixel {
	@Override
	public int r(int i, int j) {
		float s=3/(j+99);
		float y= (float) ((j+sin((i*i+pow(j-700,2)*5)/100./SIZE)*35)*s);
		return ((int)((i+SIZE)*s+y)%2+(int)((SIZE*2-i)*s+y)%2)*127;
	}
	
	@Override
	public int g(int i, int j) {
		float s= (float) (3./(j+99));
		float y= (float) ((j+sin((i*i+pow(j-700,2)*5)/100./SIZE)*35)*s);
		return ((int)(5*((i+SIZE)*s+y))%2+(int)(5*((SIZE*2-i)*s+y))%2)*127;
	}
	
	@Override
	public int b(int i, int j) {
		float s= (float) (3./(j+99));
		float y= (float) ((j+sin((i*i+pow(j-700,2)*5)/100./SIZE)*35)*s);
		return ((int)(29*((i+SIZE)*s+y))%2+(int)(29*((SIZE*2-i)*s+y))%2)*127;
	}
	
	@Override
	public String name() {
		return "3D的感觉";
	}
}
